package org.swxjava.assembler.avm1;

import org.swxjava.util.Log;
import org.swxjava.util.LogFactory;
import org.swxjava.util.StringUtils;

import org.swxjava.assembler.Constants;
import org.swxjava.assembler.ObjectCompiler;

public class AsVarString implements ObjectCompiler {

	/** Logger */
	private static final Log LOG = LogFactory.getLog(AsVarString.class);
	
	/** value */
	private String variableName = null;

	public AsVarString(String variableName) {
		this.variableName = variableName;
	}

	public int getByteSize() {
		return toString().length() / 2;
	}

	public byte[] toBytecode() {
		// TODO Auto-generated method stub
		return null;
	}

	public String toString() {
		String bytecode = Constants.NULL_TERMINATOR + StringUtils.stringToHex(variableName) + Constants.NULL_TERMINATOR;
		return bytecode.toUpperCase();
	}
}
